Skip to content

RFC 0026: Host chain discovery and name resolution - #354

Merged
valentinfernandez1 merged 6 commits into
mainfrom
rfc-0026-supported-chains
Aug 10, 2026
Merged

RFC 0026: Host chain discovery and name resolution#354
valentinfernandez1 merged 6 commits into
mainfrom
rfc-0026-supported-chains

Conversation

@valentinfernandez1

@valentinfernandez1 valentinfernandez1 commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Closes #352.

@valentinfernandez1
valentinfernandez1 requested review from a team August 6, 2026 17:21
Add the RFC document plus its protocol surface: chain.getSupportedChains (wire id 166) enumerates the chains a host serves as (name, network, genesisHash) descriptors, and chain.resolveChain (168) maps a (name, network) pair to its genesis hash or NotFound. Both trait methods are stubs returning unavailable, so products stop hard-coding genesis hashes once hosts implement the backing syscall in a follow-up.
@valentinfernandez1
valentinfernandez1 force-pushed the rfc-0026-supported-chains branch from c9fecf0 to c94a07b Compare August 6, 2026 17:21

@pgherveou pgherveou left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a single method that takes all the identifiant we want to resolve. It should be enough.

Also as you are adding this you can fix all the hard coded genesis hash from the other comment api tests

Comment thread rust/crates/truapi/src/v01/chain.rs Outdated
Comment thread rust/crates/truapi/src/v01/chain.rs Outdated
@johnthecat

Copy link
Copy Markdown
Contributor

I think more ergonomic and focused API would be

enum ChainIdentifier {
  relay,
  people,
  /// ...
}

struct ChainInfo {
  genesisHash: [u8; 32],
  name: String,
  /// ...
}

fn getChainInfo(ChainIdentifier): ChainInfo;

User don't need a full mapping every time where later he need to pick specific chain from list

Comment thread docs/rfcs/0026-supported-chains.md Outdated
@valentinfernandez1

Copy link
Copy Markdown
Collaborator Author

Thanks for the feedback, it's been implemented so feel free to review again

Comment thread docs/rfcs/0026-supported-chains.md Outdated
Comment thread docs/rfcs/0026-supported-chains.md Outdated
@valentinfernandez1
valentinfernandez1 added this pull request to the merge queue Aug 8, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 8, 2026
@filvecchiato
filvecchiato added this pull request to the merge queue Aug 8, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 8, 2026
@valentinfernandez1
valentinfernandez1 added this pull request to the merge queue Aug 10, 2026
Merged via the queue into main with commit 12a50c0 Aug 10, 2026
14 checks passed
@valentinfernandez1
valentinfernandez1 deleted the rfc-0026-supported-chains branch August 10, 2026 10:39
TarikGul added a commit that referenced this pull request Aug 11, 2026
Brings the branch up to `aa878d1f`, so the PR is mergeable again.

One conflict, in `host_core.rs`, between two additions to the same region:
this branch's native-only `impl SigningHostRuntime` carrying the renewal entry
points, and `ConnectionAdapters` from the Chat integration (#326). Both are
kept; neither references the other.

The rest of main merged cleanly, including the FFI type rename (#345),
Extrinsic V5 signing (#333), and RFC-0026 chain discovery (#354, #358).

Verified on the merge result: `cargo +nightly fmt --check`, `clippy
--workspace --all-targets --all-features -D warnings`, 683 workspace tests,
and `cargo check --target wasm32-unknown-unknown -p truapi-server`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Let products discover the host's chains instead of hard-coding genesis hashes

4 participants